package thread;

import java.util.concurrent.TimeUnit;

public class ThreadTest2 {

    private static final Object lock = new Object();
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> {
            try {
                // TimeUnit.SECONDS.sleep(5);
                synchronized(lock) {
                    lock.wait(5000);
                }
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        },"t1");
        t1.start();

        TimeUnit.SECONDS.sleep(1);

        System.out.println(t1.getState());
    }
}
